import { ISkill } from "./ISkill";
import { SkillDecorator } from "./SkillDecorator";

export class HarmSkill extends SkillDecorator {
    private optionPrefix: string = "harm";

    constructor(skill: ISkill) {
        super(skill);
    }

    createSkill(option: any): void {
        // 调用被装饰对象的方法
        this.skill.createSkill(option);
        // 添加装饰功能
        let harmValue = option[this.optionPrefix];
        console.log(`该技能伤害${harmValue}点`)
    }
}